/**文章接口 */
import request from "@/utils/request";
// 获取文章列表接口
export function getArticleList(limit, page) {
    return request({
        url: `/api/v1/article/getArticleList/${limit}/${page}`,
        method: "get",
    });
}
// 通过id获取文章接口
export function getArticleById(id) {
    return request({
        url: `/api/v1/article/readArticle/${id}`,
        method: "get",
    });
}
// 文章点赞接口
export function ArticleThumb(data) {
    return request({
        url: `/api/v1/article/like`,
        method: "post",
        data,
    });
}
// 获取用户对该文章点赞状态接口
export function getArticleThumbStatus(article_id) {
    console.log("article_id", article_id);
    return request({
        url: `/api/v1/article/like/status/${article_id}`,
        method: "get",
    });
}
// 获取文章评论列表接口
export function getCommentList(article_id, limit, page) {
    return request({
        url: `/api/v1/article/getCommentList/${article_id}/${limit}/${page}`,
        method: "get",
    });
}
// 文章评论点赞
export function CommentThumb(data) {
    return request({
        url: `/api/v1/comment/like`,
        method: "post",
        data,
    });
}
// 文章评论点赞状态获取
export function getCommentThumbStatus(comment_id) {
    return request({
        url: `/api/v1/comment/like/status/${comment_id}`,
        method: "get",
    });
}
// 回复评论列表获取接口
export function getReplyCommentList(comment_id, limit, page) {
    return request({
        url: `/api/v1/comment/getReplyList/${comment_id}/${limit}/${page}`,
        method: "get",
    });
}
// 根据id获取评论
export function getCommentById(comment_id) {
    return request({
        url: `/api/v1/comment/getCommentById/${comment_id}`,
        method: "get",
    });
}

// 回复评论点赞
export function ReplyCommentThumb(data) {
    return request({
        url: `/api/v1/comment/reply/like`,
        method: "post",
        data,
    });
}
// 回复评论点赞状态获取
export function getReplyCommentThumbStatus(reply_id) {
    return request({
        url: `/api/v1/comment/reply/like/status/${reply_id}`,
        method: "get",
    });
}
// 根据id获取回复评论
export function getReplyCommentById(reply_id) {
    return request({
        url: `/api/v1/comment/getReplyById/${reply_id}`,
        method: "get",
    });
}
// 刷新文章不改变浏览量
export function RefreshArticle(id) {
    return request({
        url: `/api/v1/article/refreshArticle/${id}`,
        method: "get",
    });
}
// 为文章添加评论
export function addComment(data) {
    return request({
        url: `/api/v1/article/addComment`,
        method: "post",
        data,
    });
}
// 通过文章id获取作者
export function getAuthorByArticleId(article_id) {
    return request({
        url: `/api/v1/article/getAuthor/${article_id}`,
        method: "get",
    });
}
// 通过作者id获取文章列表
export function getArticleByAuthorId(user_id, limit, page) {
    return request({
        url: `/api/v1/article/getArticlesByAuthor/${user_id}/${limit}/${page}`,
        method: "get",
    });
}
// 上传图片接口
export function uploadImage(data) {
    return request({
        url: `/api/v1/upload/picture`,
        method: "post",
        data,
    });
}
// 为评论添加回复评论
export function addReplyComment(data) {
    return request({
        url: `/api/v1/comment/addReply`,
        method: "post",
        data,
    });
}
// 发布文章
export function publishArticle(data) {
    return request({
        url: `/api/v1/article/publishArticle`,
        method: "post",
        data,
    });
}
// 删除文章
export function deleteArticle(data) {
    console.log(data)
    return request({
        url: `/api/v1/article/deleteArticle`,
        method: "delete",
        data,
    });
}
// 编辑文章
export function editArticle(data) {
    return request({
        url: `/api/v1/article/alter`,
        method: "put",
        data,
    });
}
// 删除已上传的图片
export function removeUploadImage(data) {
    return request({
        url: `/api/v1/article/alter`,
        method: "put",
        data,
    });
}
// 通过tagId获取文章
export function getArticleByTagId(tagId, limit, page) {
    return request({
        url: `/api/v1/tag/getArticleByTagId/${tagId}/${limit}/${page}`,
        method: "get",
    });
}
// 删除文章评论
export function deleteArticleComment(data) {
    return request({
        url: `/api/v1/comment/deleteArticleComment`,
        method: "delete",
        data,
    });
}